<!DOCTYPE html>
<html>
<head>
	{template head}
	<script type="text/javascript" src="{SITE_THEME}mvalidate/jquery-mvalidate.js"></script><!--表单认证-->
	<link rel="stylesheet" type="text/css" href="{SITE_THEME}mvalidate/validate.css">
</head>
<body class="bg pad">
<form class="edit" action="" method="post" id="myform">
	<section class="tita">
		<span>职位招聘信息</span>
	</section>
	<section class="space-8"></section>
	<section class="inpbox">
		<section class="inp">
			<section class="inp">
				<label>选择区域</label>
				<input type="text" value="区域" id="demo1" readonly="readonly">
				<input type="hidden" name="area" value="" id="value1">
			</section>
		</section>
		<section class="inp">
			<label>选择职位</label>
			<div class="check">
				{loop $position_list $p}
				<big>
					<input type="checkbox" name="position[]" value="{$p['position_name']}">{$p['position_name']}
				</big>
				{/loop}
			</div>
		</section>
		<section class="inp">
			<label>选择工种</label>
			<div class="check">
				{loop $work $t}
				<big>
					<input type="radio" value="{$t['work_id']}" name="work_id">{$t['work_name']}
				</big>
				{/loop}
			</div>
		</section>
	</section>
	<section class="space-8"></section>
	<section class="inpbox">
		<section class="inp">
			<label>公司名称:</label>
			<input type="text" name="name" value="" placeholder="请输入公司名称" data-required="true" data-descriptions="name">
		</section>
		<section class="inp">
			<label>联系人:</label>
			<input type="text" name="nikename" value="" placeholder="请填写联系人" data-required="true" data-descriptions="nikename">
		</section>
		<section class="inp">
			<label>联系电话:</label>
			<input type="text" name="phone" placeholder="请输入联系电话" data-required="true" data-descriptions="phone" data-pattern="^1[34578]{1}\d{9}$">
		</section>
		<section class="inp">
			<label>工资范围</label>
			<select required name="salary">
				{loop $salary $s}
				<option value="{$s[salary_id]}">{$s['salary_name']}</option>
				{/loop}
			</select>
		</section>
        <section class="inp">
            <label>公司介绍:</label>
            <textarea name="content" data-required="true" data-descriptions="content" cols="55" rows="10"></textarea>
        </section>
		<!--<section class="inp">-->
		<!--<label>验证码:</label>-->
		<!--<input type="text" placeholder="请输入验证码">-->
		<!--</section>-->
	</section>
	<input type="submit" value="提交招聘信息">
</form>
</body>
<script type="text/javascript">
    $(function () {
        $("#myform").mvalidate({
            type: 1,
            onKeyup: true,
            sendForm: true,
            firstInvalidFocus: true,
            valid: function (event, options) {
                //点击提交按钮时,表单通过验证触发函数
                ///alert("验证通过！接下来可以做你想做的事情啦！");
                // event.preventDefault();
            },
            invalid: function (event, status, options) {
                //点击提交按钮时,表单未通过验证触发函数
            },
            eachField: function (event, status, options) {
                //点击提交按钮时,表单每个输入域触发这个函数 this 执向当前表单输入域，是jquery对象
            },
            eachValidField: function (val) {
            },
            eachInvalidField: function (event, status, options) {
            },
            descriptions: {
                area: {
                    required: '请选择您的求职区域',
                },
                name: {
                    required: '请输入公司名称',
                },
                nikename: {
                    required: '请输入联系人',
                },
                phone: {
                    required: '请输入联系人手机号',
                    pattern: '联系人手机号格式错误',
                },
                content: {
                    required: '请输入公司介绍',
                },
//                    code: {
//                        required: '请输入验证码',
//                    },

            }
        })
        ;
    })
</script>

<script type="text/javascript">
    function unsure_click(){

    }
    function sure_click(){

    }
    var area = new LArea();
    var LAreaData = {$arr};
    area.init({
        'trigger': '#demo1',//触发选择控件的文本框，同时选择完毕后name属性输出到该位置
        'valueTo':'#value1',//选择完毕后id属性输出到该位置
        'keys':{id:'name',name:'name'},//绑定数据源相关字段 id对应valueTo的value属性输出 name对应trigger的value属性输出
        'type':0,//数据源类型
        'data':LAreaData//数据源
    });
</script>
</html>